package com.czkt.controller;


import com.czkt.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class IndexController {


    @Autowired
    SysUserService sysUserService;

    @RequestMapping("/")
    public String index(){
        return "index";
    }

    @RequestMapping("/main")
    @ResponseBody
    public String main(){
        return "main";
    }

    @RequestMapping("/list")
    public String getList(Model model){
        model.addAttribute("userList",sysUserService.list());
        return "list";
    }
}
